/* GnomeTyper 
 * Copyright (C) 2013 Juan Manuel Borges Caño <juanmabcmail@gmail.com>
 *
 * gnome-typer.h: Header for GnomeTyper application 
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef GNOME_TYPER_H
#define GNOME_TYPER_H

#include <gtk/gtk.h>
#include "libgnomekbd/gkbd-keyboard-drawing.h"

G_BEGIN_DECLS

#define GNOME_TYPE_TYPER \
  (gnome_typer_get_type())
#define GNOME_TYPER(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GNOME_TYPE_TYPER,GnomeTyper))
#define GNOME_TYPER_CAST(obj) \
  ((GnomeTyper *) (obj))
#define GNOME_TYPER_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass),GNOME_TYPE_TYPER,GnomeTyperClass))
#define GNOME_TYPER_CLASS_CAST(klass) \
  ((GnomeTyperClass *) (klass))
#define GNOME_TYPER_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS((obj),GNOME_TYPE_TYPER,GnomeTyperClass))
#define GNOME_IS_TYPER(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GNOME_TYPE_TYPER))
#define GNOME_IS_TYPER_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GNOME_TYPE_TYPER))

typedef struct _GnomeTyper GnomeTyper;
typedef struct _GnomeTyperClass GnomeTyperClass;

struct _GnomeTyper
{
  GtkApplication parent;

  struct
  {
    GFile *file;
    GFileIOStream *fileio;
    GInputStream *in;
    GOutputStream *out;
    struct
    {
      GDataInputStream *in;
    } data;
  } stream;

  struct
  {
    GTimer *timer;
    guint sourceid;
  } timing;

  GtkWidget *window;
  GtkUIManager *controller;
  PangoAttrList *attribute;

  struct
  {
    GtkWidget *past;
    GtkWidget *present;
    GtkWidget *future;
    GtkWidget *entry;
  } info;

  struct
  {
    GtkWidget *layout;
    GkbdKeyboardDrawingGroupLevel grouplevels[4];
    GkbdKeyboardDrawingGroupLevel *pgrouplevels[4];
    XkbComponentNamesRec names;
  } keyboard;

  struct
  {
    GtkWidget *status;
    GtkWidget *progress;
  } bar;

  struct
  {
    struct
    {
      guint tmp;
      guint status;
      guint count;
    } character;

    struct
    {
      guint status;
      guint count;
    } line;
  } progress;
};

struct _GnomeTyperClass
{
  GtkApplicationClass parent_class;
};

GType
gnome_typer_get_type (void);

GnomeTyper *
gnome_typer_new (void);

G_END_DECLS

#endif
